FROM swr.cn-north-4.myhuaweicloud.com/wx-2022/golang-x86_x64:1.19-alpine3.17 As buildStage
WORKDIR /go/src
COPY . /go/src
RUN  go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct; \
     go mod tidy; \
     go build -o main

FROM swr.cn-north-4.myhuaweicloud.com/wx-2022/alpine-x86_x64:3.17
WORKDIR /app
COPY --from=buildStage /go/src/main /app/
ENTRYPOINT ./main